//2009/09/09 15:47:31
#include <string>
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <math.h>
#include <sstream>
#include <algorithm>

using namespace std;

class Display
{
public:
    vector <string> transform(vector <int> x, vector <int> y)
    {
        long long mmin = 1000000000;
        long long mmax = -1000000000;
        vector<long long> xx(x.begin(), x.end());
        vector<long long> yy(y.begin(), y.end());
		
        for (int i=0; i<xx.size(); i++)
        {
            mmin = min(xx[i], mmin);
            mmax = max(xx[i], mmax);
        }
        double ratio = fabs(1000.0 / (mmax-mmin));
		cout << "ratio: " << ratio << endl;
		cout << "X: " << endl;
        for (int i=0; i<xx.size(); i++)
        {
            xx[i] += -mmin;
			cout << xx[i] <<", ";
            xx[i] = round(ratio * xx[i]);
			
        }
		cout << endl;

        mmin = 1000000000;
		mmax = -1000000000;
        for (int i=0; i<yy.size(); i++)
        {
            mmin = min(yy[i], mmin);
            mmax = max(yy[i], mmax);
        }
		ratio = fabs(1000.0 / (mmax-mmin));
		cout << "Y: " << endl;
        for (int i=0; i<yy.size(); i++)
        {
            yy[i] += -mmin;
			cout << yy[i] << ", ";
            yy[i] = round(ratio * yy[i]);
			
        }
		cout << endl;
		vector<string> ret;
		for(int i=0; i<xx.size(); i++)
		{
			stringstream s;
			s << xx[i] << " " << yy[i];
			ret.push_back(s.str());
		}
		return ret;
    }
};
